/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pak;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Marcin
 */
public abstract class CSterownikBazyDanych
{
    protected String url;
    protected String haslo;
    protected String login;
    protected String blad;
    
    protected int czas = 0;
    
    Connection connection = null;
    //--------------------------------------------------------------------------
    CSterownikBazyDanych ()
    {
        blad = new String ();
    }
    //--------------------------------------------------------------------------
    public void ustawLoginIHaslo (String login, String haslo)
    {
        this.login  = login;
        this.haslo  = haslo;
    }
    //--------------------------------------------------------------------------
    public String pobierzLogin ()
    {
        return this.login;
    }
    //--------------------------------------------------------------------------
    public String pobierzBlad ()
    {
        return this.blad;
    }
    //--------------------------------------------------------------------------
    public void zamknijPolaczenie ()
    {
        try 
        {
            connection.close();
            
        } catch (SQLException ex) 
        {
            Logger.getLogger(CSterownikBazyDanych.class.getName()).log(Level.SEVERE, null, ex);
            this.blad = "Blad przy zamykaniu polaczenia.";
        }
    }
    //--------------------------------------------------------------------------
    abstract public boolean polacz ();
    
    
}
